package domain

import (
	"apitestAfterGo/dto"
	"time"
)

type User struct {
	Id         int       `json:"id"`
	Username   string    `json:"username"`
	Password   string    `json:"password"`
	Salt       string    `json:"salt"`
	Urls       string    `json:"urls"`
	IsActive   int       `json:"is_active"`
	CreateBy   string    `json:"create_by"`
	CreateTime time.Time `json:"create_time"`
	UpdateBy   string    `json:"update_by"`
	UpdateTime time.Time `json:"update_time"`
	IsDelete   int       `json:"is_delete" gm:"logic"`
}

type UserMapper struct {
	SelectTemplate           func(username string) (User, error) `args:"username"`
	InsertByUser             func(arg User) (int64, error)
	DeleteTemplate           func(id int) (int64, error) `args:"id"`
	GetUserById              func(id int) (User, error)  `args:"id"`
	GetAllUserByPage         func(dto dto.SearchInputDto) ([]User, error)
	CountUsers               func(value string) (int, error)     `args:"value"`
	GetUserByUserName        func(username string) (User, error) `args:"username"`
	ChangeStatus             func(status User) (int64, error)
	UpdatePasswordByUsername func(arg User) (int64, error)
	GetAllUser               func() ([]User, error)
}
